//
//  DataItem.h
//  OR_1
//
//  Created by Luboš Kulič on 8/21/10.
//  Copyright 2010 __MyCompanyName__. All rights reserved.
//

#import <UIKit/UIKit.h>



/**
 Protocol for every data entities from ARES, for example OR basic data, Person, etc.

 Will probably be further differentiated according to data nature and type of presentation (i.e. - shown in a table, list of values,...)
 
 Description items == element's own data
 Value items == subelements
 
 */
@protocol DataItem   

// data item type, e.g. name of the element ("Zakladni udaje", "Cinnosti", ...)
-(NSString *) itemType;

/// Returns number of data items hold. 
-(NSUInteger) numberOfValues;

-(NSUInteger) numberOfDescriptionItems;  // ds	

/// index being either string (for named data) or numeric index (for array data)
-(id<DataItem>) descriptionWithIndex:(id)index;

-(id<DataItem>) valueWithIndex:(id)index; 
// TODO: - udelat indexy jako string -> data item nemusi vedet nic o poradi na view

@end


extern NSString * const DataItemTypeArray;
extern NSString * const DataItemTypeSimple;


@protocol SimpleDataItem <DataItem>

@end


@protocol ComplexDataItem <DataItem>

@end


@protocol ArrayDataItem <DataItem>

@end





typedef NSObject<DataItem> DataItem;
typedef NSObject<SimpleDataItem> SimpleDataItem;
typedef NSObject<ComplexDataItem> ComplexDataItem;
typedef NSObject<ArrayDataItem> ArrayDataItem;




//@interface SimpleDataItem (SimpleDataItemDefaultImpl) 
//
//-(NSUInteger) numberOfValues;
//
//-(NSUInteger) numberOfDescriptionItems;
//
//-(id<DataItem>) descriptionWithIndex:(NSUInteger)index;
//
//-(id<DataItem>) valueWithIndex:(NSUInteger)index;
//
//
//@end
//
//
//@interface ComplexDataItem (ComplexDataItemDefaultImpl) 
//
//-(NSUInteger) numberOfValues;
//
//-(NSUInteger) numberOfDescriptionItems;
//
//-(id<DataItem>) descriptionWithIndex:(NSUInteger)index;
//
//-(id<DataItem>) valueWithIndex:(NSUInteger)index;
//
//@end





































